package cn.starlightsoftware.sherly.controller.admin.user.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import cn.starlightsoftware.sherly.enums.GenderEnum;
import cn.starlightsoftware.sherly.enums.UsableEnum;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

/**
 * @author 谷子毅
 */
@Data
public class UserSaveReqVO {

    @Schema(description = "用户编号", example = "111111")
    private String userId;

    @Schema(description = "昵称", example = "Gucci")
    private String nickname;

    @Schema(description = "用户账号", requiredMode = REQUIRED, example = "gzy520")
    @NotBlank
    @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$")
    private String username;

    @Schema(description = "手机号", requiredMode = REQUIRED, example = "18888888888")
    private String phone;

    @Schema(description = "邮箱", example = "abc@qq.com")
    @Email
    private String email;

    @Schema(description = "性别", requiredMode = REQUIRED, example = "FEMALE")
    private GenderEnum gender;

    @Schema(description = "是否可用", example = "ENABLE")
    @NotNull
    private UsableEnum usable;

}
